package org.service.es.entity;

import lombok.Data;
import org.dromara.easyes.annotation.HighLight;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.rely.Analyzer;
import org.dromara.easyes.annotation.rely.FieldType;
import org.dromara.easyes.annotation.rely.IdType;

import java.util.List;

/**
 * @author grl
 * @date 2022/12/12
 */
@Data
@IndexName("super_service_bean")
public class EsSuperServiceBean {

    /**
     * ES 实体Id
     */
    @IndexId(type = IdType.CUSTOMIZE)
    private String beanId;
    /**
     * Es 实体类型
     * 1.本地服务
     * 2.pageIndex
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer beanType;
    /**
     * 数据库中的id
     * beanType =1 时 为 realId
     */
    @IndexField(fieldType = FieldType.LONG)
    private Long originId;
    /**
     * 模块ID
     */
    @IndexField(fieldType = FieldType.LONG)
    private Long pageIndexId;
    /**
     * 标题
     */
//    @MultiField(
//            mainField=@IndexField(fieldType = FieldType.Text, analyzer = "ik_max_word"),
//            otherFields = {@InnerField(suffix = "standard", type = FieldType.Text, analyzer = "standard")
//            })
    @IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_MAX_WORD)
    @HighLight(mappingField = "titleHighlight")
    private String title;

    private String titleHighlight;

    /**
     * 排序
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer sort;
    /**
     * 原始类型
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer originType;
    /**
     * 创建时间
     */
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @IndexField(fieldType = FieldType.DATE)
    private String createTime;
    /**
     * 发布时间
     */
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @IndexField(fieldType = FieldType.DATE)
    private String upTime;
    /**
     * 更新时间
     */
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @IndexField(fieldType = FieldType.DATE)
    private String updateTime;
    /**
     * 跳转链接
     */
    @IndexField(fieldType = FieldType.KEYWORD)
    private String jumpUrl;

    /**
     * parent_id
     */
    @IndexField(fieldType = FieldType.LONG)
    private Long parentId;
    /**
     * 图片链接
     */
    @IndexField(fieldType = FieldType.KEYWORD)
    private String pictureUrl;

    /**
     * 跳转类型1 H5链接跳转 2 原生跳转
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer jumpType;
    /**
     * 1 是 0 否  是否需要拉取授权页面
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer needAuth;
    /**
     * remark
     */
    @IndexField(fieldType = FieldType.KEYWORD)
    private String remark;
    /**
     * 归档类型
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer archiveType;
    /**
     * 版本
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer versionCode;
    /**
     * 补充的额外字段
     */
    @IndexField(fieldType = FieldType.KEYWORD)
    private String primitiveMsg;
    /**
     * 跳转类型 0 国防法规 1 军属网证
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer primitiveType;
    /**
     * 页面id
     */
    @IndexField(fieldType = FieldType.LONG)
    private Long indexId;
    /**
     * 同组标记；用于将内容放在统一组下的标记
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer pictureGroup;
    /**
     * 图片显示尺寸(长乘宽)的格式
     */
    @IndexField(fieldType = FieldType.KEYWORD)
    private String pictureSize;
    /**
     * 展示模式 1横穿
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer pictureShowType;
    /**
     * 用户组
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private List<Integer> userGroup;

    @IndexField(fieldType = FieldType.KEYWORD)
    private List<String> location;

    /**
     * 下级
     */
    private List<EsSuperServiceBean> secondary;

    @IndexField(fieldType = FieldType.KEYWORD)
    private String esPicture;

}
